<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>交易详情</title>
    <link rel="stylesheet" href="../../sq/css/public.css">
    <link rel="stylesheet" type="" href="http://at.alicdn.com/t/font_5ufdxzeyp919k9.css">
    <link rel="stylesheet" type="" href="../../sq/css/detail.css">
    <!-- <script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script> -->
</head>
<body>
<div id="header">
    <span class="left" onclick="window.history.go(-1)"><i class="icon iconfont icon-fanhui"></i></span>
    <p>交易详情</p>
</div>
<div class="resulte">

</div>
</body>
</html>
<script type="text/html" id="res">
    <div class="money">
        <% if(orderInfo.order_state==20 && orderInfo.recive==1 ) { %>
            <div style="color:#f94c48"><i class="icon iconfont icon-duihao" style="margin-right:-7px;color:#f94c48"></i> 成功收到金额</div>
            <div class="jine">￥<%= orderInfo.order_amount %></div>
        <% } %>
        <% if(orderInfo.order_state==20 && orderInfo.recive==0 ) { %>
        <div style="color:#f94c48"><i class="icon iconfont icon-gantan" style="margin-right:-7px;color:#f94c48"></i> 等待商家确认收款</div>
        <div class="jine">￥<%= orderInfo.order_amount %></div>
        <% } %>
        <% if(orderInfo.order_state==10) { %>
        <div style="color:#f94c48"><i class="icon iconfont icon-gantan" style="margin-right:5px;color:#f94c48"></i> 等待用户付款</div>
        <div class="jine">￥<%= orderInfo.order_amount %></div>
        <% } %>
        <% if(orderInfo.order_state==0) { %>
        <div style="color:#f94c48"><i class="icon iconfont icon-cuohao" style="margin-right:5px;color:#f94c48"></i> 订单已取消</div>
        <div class="jine">￥<%= orderInfo.order_amount %></div>
        <% } %>
    </div>
    <div class="details">
            <p>客户昵称: <span><%= orderInfo.buyer_name %></span></p>
    <p>订单编号: <span><%= orderInfo.order_sn %></span></p>
    <p>交易时间: <span><%= orderInfo.time %></span></p>
    <p>交易方式: <span><% if(orderInfo.payment_code=='predeposit') { %>余额支付<% }%><% if(orderInfo.payment_code=='wx_jsapi') { %> 微信支付 <% } %><% if(orderInfo.payment_code=='navgator') { %> 线下支付 <% } %></span> </p>
    </div>
    <div class="button" onclick="window.history.back()">关闭订单</div>
</script>
<script type="text/javascript" src="../../js/config.js"></script>

<script type="text/javascript" src="../../js/zepto.min.js"></script>
<script type="text/javascript" src="../../js/common.js"></script>
<script type="text/javascript" src="../../js/template.js"></script>
<script>
    $(function(){
        var key = getCookie('key');
        var storeid = getCookie('sqstoreid');
        var paySn = getQueryString('paysn');
        if(!key||!storeid){
            window.location.href = '/sq/login.html';
        }
        $.ajax({
            type:"GET",
            url:ApiUrl+"/index.php?act=store&op=offline_order_info",
            data:{key:key,paysn:paySn},
            dataType:"json",
            success:function(data){
                console.log(data);
                $('.resulte').html(template.render('res',data.datas))
            }
        })

    })
    var w = document.documentElement.clientWidth;
        document.documentElement.style.fontSize = w/32+"px";

    window.onresize = function(){
        var w = document.documentElement.clientWidth;
        document.documentElement.style.fontSize = w/32+"px";
    }
</script>